package freshmanspecial.mredrock.com.welcomefreshman.View;

import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.TextView;

import freshmanspecial.mredrock.com.welcomefreshman.Base.BaseActivity;
import freshmanspecial.mredrock.com.welcomefreshman.Presenter.MainPresenter;
import freshmanspecial.mredrock.com.welcomefreshman.R;

public class MainView extends BaseActivity implements IMainView{
    private CardView cardView_goToDataView,cardView_goToMienView,cardView_goToStrategyView,cardView_goToTrainView;
    private MainPresenter mainPresenter;
    private TextView title;

    @Override
    protected void initData() {
        title = $(R.id.text_titlebar);
        title.setText("2017迎新网");
        cardView_goToDataView = $(R.id.data);
        cardView_goToMienView = $(R.id.mien);
        cardView_goToStrategyView = $(R.id.str);
        cardView_goToTrainView = $(R.id.train);
        mainPresenter = new MainPresenter(this);
        setOnClick();
    }

    @Override
    protected int getContentViewId() {
        return R.layout.special_2017_mainview;
    }

    @Override
    public void setOnClick() {
        cardView_goToDataView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mainPresenter.goToDataView();
            }
        });
        cardView_goToMienView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mainPresenter.goToMienView();
            }
        });
        cardView_goToStrategyView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mainPresenter.goToStrategyView();
            }
        });
        cardView_goToTrainView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mainPresenter.goTotrainView();
            }
        });
    }
}
